.TH std::ctype_byname 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::ctype_byname \- std::ctype_byname

.SH Synopsis
   Defined in header <locale>
   template<>
   class ctype_byname : public std::ctype<char>;

   This specialization of std::ctype_byname encapsulates character classification
   features for type char. Like its base class std::ctype<char> and unlike
   general-purpose std::ctype_byname, table lookup is used to classify characters

.SH Member types

   Member type Definition
   mask        ctype<char>::mask

.SH Member functions

   constructor   constructs a new ctype_byname<char> facet
                 \fI(public member function)\fP
   destructor    destructs a ctype_byname<char> facet
                 \fI(protected member function)\fP

Inherited from std::ctype<char>

.SH Member types

   Member type Definition
   char_type   char

.SH Member objects

   Member name               Type
   id (static)               std::locale::id
   table_size (static const) std::size_t size of the classification table, at least 256

.SH Member functions

   table         obtains the character classification table
                 \fI(public member function of std::ctype<char>)\fP
   classic_table obtains the "C" locale character classification table
   \fB[static]\fP      \fI(public static member function of std::ctype<char>)\fP
                 classifies a character or a character sequence, using the
   is            classification table
                 \fI(public member function of std::ctype<char>)\fP
                 locates the first character in a sequence that conforms to given
   scan_is       classification, using the classification table
                 \fI(public member function of std::ctype<char>)\fP
                 locates the first character in a sequence that fails given
   scan_not      classification, using the classification table
                 \fI(public member function of std::ctype<char>)\fP
   toupper       invokes do_toupper
                 \fI(public member function of std::ctype<CharT>)\fP
   tolower       invokes do_tolower
                 \fI(public member function of std::ctype<CharT>)\fP
   widen         invokes do_widen
                 \fI(public member function of std::ctype<CharT>)\fP
   narrow        invokes do_narrow
                 \fI(public member function of std::ctype<CharT>)\fP

.SH Protected member functions

   do_toupper converts a character or characters to uppercase
   \fB[virtual]\fP  \fI(virtual protected member function of std::ctype<CharT>)\fP
   do_tolower converts a character or characters to lowercase
   \fB[virtual]\fP  \fI(virtual protected member function of std::ctype<CharT>)\fP
   do_widen   converts a character or characters from char to CharT
   \fB[virtual]\fP  \fI(virtual protected member function of std::ctype<CharT>)\fP
   do_narrow  converts a character or characters from CharT to char
   \fB[virtual]\fP  \fI(virtual protected member function of std::ctype<CharT>)\fP

Inherited from std::ctype_base

.SH Member types

   Type Definition
   mask unspecified bitmask type (enumeration, integer type, or bitset)

.SH Member constants

   space            the value of mask identifying whitespace character classification
   \fB[static]\fP         \fI(public static member constant)\fP
   print            the value of mask identifying printable character classification
   \fB[static]\fP         \fI(public static member constant)\fP
   cntrl            the value of mask identifying control character classification
   \fB[static]\fP         \fI(public static member constant)\fP
   upper            the value of mask identifying uppercase character classification
   \fB[static]\fP         \fI(public static member constant)\fP
   lower            the value of mask identifying lowercase character classification
   \fB[static]\fP         \fI(public static member constant)\fP
   alpha            the value of mask identifying alphabetic character classification
   \fB[static]\fP         \fI(public static member constant)\fP
   digit            the value of mask identifying digit character classification
   \fB[static]\fP         \fI(public static member constant)\fP
   punct            the value of mask identifying punctuation character classification
   \fB[static]\fP         \fI(public static member constant)\fP
   xdigit           the value of mask identifying hexadecimal digit character
   \fB[static]\fP         classification
                    \fI(public static member constant)\fP
   blank            the value of mask identifying blank character classification
   \fB[static]\fP \fI(C++11)\fP \fI(public static member constant)\fP
   alnum            alpha | digit
   \fB[static]\fP         \fI(public static member constant)\fP
   graph            alnum | punct
   \fB[static]\fP         \fI(public static member constant)\fP

.SH Example


// Run this code

 #include <iostream>
 #include <locale>

 int main()
 {
     char c = '\\xde'; // capital letter thorn

     std::locale loc("C");

     std::cout << "isupper('Þ', C locale) returned "
                << std::boolalpha << std::isupper(c, loc) << '\\n';

     loc = std::locale(loc, new std::ctype_byname<char>("en_US.utf8"));

     std::cout << "isupper('Þ', C locale with Unicode ctype<char>) returned "
               << std::boolalpha << std::isupper(c, loc) << '\\n';

     loc = std::locale(loc, new std::ctype_byname<char>("is_IS.iso88591"));

     std::cout << "isupper('Þ', C locale with Islandic ctype<char>) returned "
               << std::boolalpha << std::isupper(c, loc) << '\\n';
 }

.SH Output:

 isupper('Þ', C locale) returned false
 isupper('Þ', C locale with Unicode ctype<char>) returned false
 isupper('Þ', C locale with Islandic ctype<char>) returned true

.SH See also

   ctype       defines character classification tables
               \fI(class template)\fP
   ctype<char> specialization of std::ctype for type char
               \fI(class template specialization)\fP
